package com.example.iotmanagerment26.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.gson.annotations.SerializedName;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 作者：太难猫
 * 创建时间： 2025/6/4 16:08
 */
@Component
public class Data {
    int id;
    @SerializedName("devid")
    String name;
    double temperature;
    double humidity;
    double light;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    Date time;
    String memo;

    public Data() {
    }

    public Data(int id, String name, double temperature, double humidity, double light, Date time, String memo) {
        this.id = id;
        this.name = name;
        this.temperature = temperature;
        this.humidity = humidity;
        this.light = light;
        this.time = time;
        this.memo = memo;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getTemperature() {
        return temperature;
    }

    public void setTemperature(double temperature) {
        this.temperature = temperature;
    }

    public double getHumidity() {
        return humidity;
    }

    public void setHumidity(double humidity) {
        this.humidity = humidity;
    }

    public double getLight() {
        return light;
    }

    public void setLight(double light) {
        this.light = light;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Override
    public String toString() {
        return "Data{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", temperature=" + temperature +
                ", humidity=" + humidity +
                ", light=" + light +
                ", time=" + time +
                ", memo='" + memo + '\'' +
                '}';
    }
}